package com.my.order.config;

import org.apache.ibatis.plugin.Interceptor;
import org.apache.ibatis.plugin.Invocation;
import org.springframework.stereotype.Component;

import java.util.Properties;

/**
 * 自定义mybatis执行拦截器，在执行sql脚本之前会执行此拦截器中的逻辑
 *
 * 添加@Component注解后，会自动注册到InterceptorChain的执行链之中，在每次创建Executor实例之前会执行。
 * @author zhaodongchao
 * @date 2020/4/20 19:03
 */
@Component
public class MyInterceptor implements Interceptor {
    @Override
    public Object intercept(Invocation invocation) throws Throwable {
        return invocation.proceed();
    }

    @Override
    public Object plugin(Object target) {
        return target;
    }

    @Override
    public void setProperties(Properties properties) {

    }
}
